 
@{
    ViewBag.Title = "新增/编辑";
    Layout = "~/Areas/Admin/Views/Shared/_Layout_Edit.cshtml";
}
<form class="layui-form" method="post" action="/Admin/AdvPosition/Save" id="myForm" autocomplete="off">
    <input type="hidden" value="@Model.Id" name="Id" /> 
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"> 
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show"> 
               <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>广告位名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="Name" required lay-verify="required" autocomplete="off" class="layui-input" maxlength="10" value="@Model.Name">
                    </div>
                </div> 
               <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>广告位编码</label>
                    <div class="layui-input-block">
                        <input type="text" name="Code" required lay-verify="required" autocomplete="off" class="layui-input" maxlength="10" value="@Model.Code">
                    </div>
                </div> 
               <div class="layui-form-item">
                    <label class="layui-form-label">长(px)</label>
                    <div class="layui-input-block">
                        <input type="text" name="Height" autocomplete="off" class="layui-input" maxlength="20" value="@Model.Height">
                    </div>
                </div> 
               <div class="layui-form-item">
                    <label class="layui-form-label">宽(px)</label>
                    <div class="layui-input-block">
                        <input type="text" name="Width" autocomplete="off" class="layui-input" maxlength="20" value="@Model.Width">
                    </div>
                </div>          
            </div> 
        </div>
    </div>
    <div class="layui-footer">
        <button type="button" class="layui-btn layui-btn-primary" onclick="win.close()">关闭</button>
        <button type="button" class="layui-btn" lay-submit lay-filter="formSubmit">保存</button>
    </div>
</form>
@section Scripts{
    <script type="text/javascript">
        $(function () { 

            layui.use('element', function () {
                var $ = layui.jquery, element = layui.element;
            });
            layui.use('form', function () {
                var form = layui.form;
                form.verify($.verify);
                //监听提交
                form.on('submit(formSubmit)', function (data) {
                    win.showLoading("正在保存...");
                     
                    $("#myForm").ajaxSubmit(function (res) {
                        win.hideLoading();
                        if (res.code == 0) {
                            parent.getList();
                            parent.win.success("保存成功");
                            win.close();
                        } else {
                            win.alert(res.message);
                        }
                    });
                    return false;
                }); 
            }); 
        });
    </script>
}
	 
